Adjustable wireless circuitry with antenna-based proximity detector

ABSTRACT

An electronic device such as a portable electronic device has wireless communications circuitry. Antennas in the electronic device may be used in transmitting radio-frequency antenna signals. A coupler and antenna signal phase and magnitude measurement circuitry may be used to determine when external objects are in the vicinity of the antenna by making antenna impedance measurements. In-band and out-of-band phase and magnitude signal measurements may be made in determining whether external objects are present. Additional sensors such as motion sensors, light and heat sensors, acoustic and electrical sensors may produce data that can be combined with the proximity data gathered using the antenna-based proximity sensor. In response to detecting that an external object such as a user&#39;s body is within a given distance of the antenna, the electronic device may reduce transmit powers, switch antennas, steer a phased antenna array, switch communications protocols, or take other actions.

This application is a division of patent application Ser. No.14/219,946, filed Mar. 19, 2014, which is a continuation of patentapplication Ser. No. 12/759,243, filed Apr. 13, 2010, each of which ishereby incorporated by reference herein in its entirety. Thisapplication claims the benefit of and claims priority to patentapplication Ser. No. 14/219,946, filed Mar. 19, 2014, which is acontinuation of patent application Ser. No. 12/759,243, filed Apr. 13,2010

BACKGROUND

This relates generally to wireless communications circuitry, and moreparticularly, to electronic devices that have wireless communicationscircuitry whose operation may be adjusted based on the proximity of theelectronic devices to external objects.

Electronic devices such as computers and handheld electronic devices arebecoming increasingly popular. Devices such as these are often providedwith wireless communications capabilities. For example, electronicdevices may use long-range wireless communications circuitry such ascellular telephone circuitry to communicate using cellular telephonebands. Electronic devices may use short-range wireless communicationslinks to handle communications with nearby equipment. For example,electronic devices may communicate using the WiFi® (IEEE 802.11) bandsat 2.4 GHz and 5 GHz and the Bluetooth® band at 2.4 GHz.

To satisfy consumer demand for small form factor wireless devices,manufacturers are continually striving to implement wirelesscommunications circuitry such as antenna components using compactstructures. To satisfy regulatory guidelines for maximum emitted power,it may be desirable to limit the radio-frequency output of an electronicdevice. Care must be taken, however, to ensure that the proper wirelessoperation of the electronic device is not disrupted. If emitted wirelesssignal strengths are overly limited, a device may not functionsatisfactorily.

In view of these considerations, it would be desirable to provideimproved wireless circuitry for electronic devices.

SUMMARY

Electronic devices such as portable electronic devices may be providedwith one or more antennas. The antennas may operate in a commoncommunications band (e.g., when implementing an antenna diversityarrangement) or may operate in separate communications bands. An arrayof antennas may be controlled using phase controllers to implement aphased antenna array capable of beam steering. Antennas may be providedwith tunable matching networks, tunable feeds, tunable antennaresonating elements, and adjustable tuning circuits.

The electronic device may determine whether a user's body or otherexternal object is within a given distance of an antenna by makingantenna impedance measurements. The antenna impedance measurements maybe made using signal phase and magnitude monitoring circuitry that iscoupled to the antenna.

The electronic device may also include other sensors such as thermalsensors, infrared heat sensors, motion sensors, capacitance sensors,ambient light sensors, infrared light proximity sensors, acousticsensors, cameras, electrical (resistance) sensors, etc. Data from eachof these sensors may be used in addition to the antenna impedancemeasurement data to help accurately determine whether the externalobject is in the vicinity of the antenna.

Transceiver and power amplifier circuitry may be used in transmittingradio-frequency antenna signals through the antenna. A communicationsprotocol, transmit data rate, and a given communications band may beused when transmitting signals.

Storage and processing circuitry may process information from anantenna-based proximity sensor and from other sensors and sources ofdata within the electronic device to determine when external objects arewithin a given distance of the antennas in the device are how torespond. Appropriate actions that may be taken when an external objectis detected include adjustments to transmit power through the antenna,adjustments to the type of communications protocol that is being used,adjustments to the rate at which data is being wirelessly transmitted,and adjustments to the communications band that is being used forwireless transmissions. Antennas may be selectively disabled and mayhave their powers adjusted individually. In a phased antenna array, thedirection in which the antenna array is operating may be adjusted. Theantennas in the device may also be tuned in response to the detection ofexternal objects by adjusting matching circuits, antenna feed locations,tuning circuits, and adjustable switches that control the size and shapeof the active portions of antenna resonating elements within theantennas.

Further features of the invention, its nature and various advantageswill be more apparent from the accompanying drawings and the followingdetailed description of the preferred embodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a perspective view of an illustrative electronic device withwireless communications circuitry in accordance with an embodiment ofthe present invention.

FIG. 2 is a schematic diagram of an illustrative electronic device withwireless communications circuitry in accordance with an embodiment ofthe present invention.

FIG. 3 is circuit diagram of illustrative wireless circuitry in anelectronic device in accordance with an embodiment of the presentinvention.

FIG. 4 is a circuit diagram showing illustrative circuitry that may beused to measure radio-frequency antenna signals in real time duringoperation of an electronic device in accordance with an embodiment ofthe present invention.

FIG. 5 is a Smith chart showing how antenna impedance may vary inresponse to the presence or absence of different types of externalobjects in accordance with an embodiment of the present invention.

FIG. 6 is a diagram of an illustrative adjustable antenna matchingcircuit, an illustrative adjustable antenna feed, illustrativeadjustable antenna tuning circuitry, and an adjustable antennaresonating element for an adjustable antenna in accordance with anembodiment of the present invention.

FIG. 7 is a schematic diagram of an illustrative electronic device withmultiple antennas in accordance with an embodiment of the presentinvention.

FIG. 8 is a diagram of an illustrative phased antenna array that may beadjusted in real time using control circuitry in an electronic device inaccordance with an embodiment of the present invention.

FIG. 9 is a flow chart of illustrative steps involved in operating anelectronic device with sensors and wireless circuitry in accordance withan embodiment of the present invention.

DETAILED DESCRIPTION

Electronic devices may be provided with wireless communicationscircuitry. The wireless communications circuitry may be used to supportwireless communications such as long-range wireless communications(e.g., communications in cellular telephone bands) and short-rangecommunications (i.e., local area network links such as WiFi® links,Bluetooth® links, etc.). The wireless communications circuitry mayinclude one or more antennas.

The electronic devices may include proximity sensors that areimplemented using circuitry that monitors antenna signals. A proximitysensor of this type may, for example, discern whether a user's hand orother body part is in the vicinity of an antenna in an electronicdevice. Other sensor data may also be gathered by the device.

Processing circuitry may be used to process the antenna signal proximitysensor data and other data to determine when it is necessary to adjustthe wireless circuitry. The processing circuitry may decide to adjustthe wireless circuitry whenever appropriate criteria have beensatisfied. Examples of criteria that might be used to determine when awireless circuit adjustment is appropriate include criteria specifyinghow close a user's body may be located to a particular antenna asdetermined by a radio-frequency antenna signal proximity sensor, whichantennas in an array are close to a user's body, how a device is beingoriented, what type of applications are currently running on the device,whether the device is moving, whether an external object appears to bein the vicinity of the device as measured by a light sensor, heatsensor, infrared light or heat sensor, acoustic sensor, or capacitivesensor, etc.

After gathering proximity data and other suitable data using one or moreof these sensors, the processing circuitry may take appropriate action.Examples of actions that may be taken include adjusting the amount ofradio-frequency power that is transmitted through each antenna,switching to a desired antenna mode (e.g., switching between a mode inwhich multiple antennas are used to a mode in which a single antenna isused or vice versa), adjusting a phased antenna array (e.g., to steer anantenna away from the user's body), adjusting which communications bandsare active, adjusting how fast data is transmitted, delaying datatransmission for particular types of data, switching whichcommunications protocol is being used, issuing an alert, prompting auser to take a particular action such as reorienting the device, etc.Proximity data may sometimes be a particularly reliable form of data touse in controlling radio-frequency emissions from wireless circuitry,but ancillary data such as data from other sensors and data on thecurrent operation of a device may be used to increase the accuracy andappropriateness of any actions that are taken. Changes in output powerand other adjustments that are being made in response to antenna-basedproximity sensor data and other gathered data may be made in conjunctionwith changes in output power that are made in response to transmit powercommands received from a cellular network.

Any suitable electronic devices may be provided with wireless circuitrythat is controlled in this way. As an example, control techniques suchas these may be used in electronic devices such as desktop computers,game consoles, routers, laptop computers, computers embedded in acomputer monitor or television, computers that are part of set-top boxesor other consumer electronics equipment, relatively compact electronicdevices such as portable electronic devices, etc. The use of portableelectronic devices is sometimes described herein as an example. This is,however, merely illustrative. Wireless circuitry may be controlled basedon proximity data and other information in any electronic device.

An illustrative portable electronic device in accordance with anembodiment of the present invention is shown in FIG. 1. Portableelectronic devices such as illustrative portable electronic device 10 ofFIG. 1 may be laptop computers or small portable computers such asultraportable computers, netbook computers, and tablet computers.Portable electronic devices may also be somewhat smaller devices.Examples of smaller portable electronic devices include wrist-watchdevices, pendant devices, headphone and earpiece devices, and otherwearable and miniature devices. With one suitable arrangement, theportable electronic devices are handheld electronic devices such ascellular telephones. Other examples of handheld devices include mediaplayers with wireless communications capabilities, handheld computers(also sometimes called personal digital assistants), remote controllers,global positioning system (GPS) devices, and handheld gaming devices.Handheld devices and other portable devices may, if desired, include thefunctionality of multiple conventional devices. Examples ofmulti-functional devices include cellular telephones that include mediaplayer functionality, gaming devices that include wirelesscommunications capabilities, cellular telephones that include game andemail functions, and handheld devices that receive email, support mobiletelephone calls, and support web browsing. These are merely illustrativeexamples. Device 10 of FIG. 1 may be any suitable portable or handheldelectronic device.

Device 10 includes housing 12. Housing 12, which is sometimes referredto as a case, may be formed of any suitable materials including plastic,glass, ceramics, carbon-fiber composites and other composites, metal,other suitable materials, or a combination of these materials. Device 10may be formed using a unibody construction in which most or all ofhousing 12 is formed from a single structural element (e.g., a piece ofmachined metal or a piece of molded plastic) or may be formed frommultiple housing structures (e.g., outer housing structures that havebeen mounted to internal frame elements or other internal housingstructures).

Device 10 may, if desired, have a display such as display 14. Display 14may, for example, be a touch screen that incorporates capacitive touchelectrodes. Display 14 may include image pixels formed formlight-emitting diodes (LEDs), organic LEDs (OLEDs), plasma cells,electronic ink elements, liquid crystal display (LCD) components, orother suitable image pixel structures. A cover glass member may coverthe surface of display 14. Buttons such as button 16 may pass throughopenings in the cover glass. Openings may also be formed in the coverglass of display 14 to form a speaker port such as speaker port 18.Openings in housing 12 may be used to form input-output ports,microphone ports, speaker ports, button openings, etc.

Wireless communications circuitry in device 10 may be used to formremote and local wireless links. One or more antennas may be used duringwireless communications. Single-band and multiband antennas may be used.For example, a single-band antenna may be used to handle Bluetooth®communications at 2.4 GHz (as an example). As another example, amultiband antenna may be used to handle cellular telephonecommunications in multiple cellular telephone bands. Other types ofcommunications links may also be supported using single-band andmultiband antennas.

If desired, device 10 may use multiple antennas to support an antennadiversity scheme. With this type of arrangement, control circuitry indevice 10 may monitor signal quality or sensor data to determine whichantenna or antennas are performing best or are otherwise desirable touse (e.g., to satisfy regulatory limits). Based on these considerations,the control circuitry may then choose to use only a subset of theantennas or may otherwise adjust antenna use. If, for example, a sensoror a signal quality measurement determines that one of two antennas inan antenna diversity arrangement has become blocked by an externalobject such as part of a human body, the control circuitry maytemporarily inactivate that antenna.

Device 10 may also use multiple antennas to implement amultiple-input-multiple-output (MIMO) communications protocol (e.g., toenhance data throughput). The control circuitry in device 10 may useproximity data or other data to control operation of the multipleantennas in the MIMO setup. For example, the control circuitry maytemporarily switch from MIMO operation to a protocol that uses only asingle antenna or may switch from a four-antenna MIMO scheme to atwo-antenna MIMO scheme, etc.

Device 10 may include a phased antenna array. The array may includemultiple antenna elements (i.e., multiple antennas). Control circuitrymay be used to control the signals that are routed to and from theantenna elements (e.g., by controlling signal phases). The controlcircuitry can alter the direction in which the antenna operates. If, forexample, it is desired to point the antenna in a first direction, thecontrol circuitry can use a first group of antenna element phasesettings. If it is desired to point the antenna in a second directionthat is different than the first direction, the control circuitry canuse a distinct second group of phase settings. Using this approach, thepower of the radio-frequency signals that are emitted by the antennaarray can be steered to avoid or minimize emissions into externalobjects (e.g., to comply with regulatory limits by avoidingradio-frequency emissions into human tissue).

Combinations of these approaches may also be used. For example, thecontrol circuitry in device 10 may use proximity sensor information orother sensor data to determine the location of external objects relativeto the device. The control circuitry can also ascertain what tasks arebeing performed by the device and what tasks are scheduled to beperformed or are likely to be performed. As an example, the controlcircuitry can determine that a user is currently using device 10 for atelephone call or can determine that an email message has been queued upfor transmission or is likely to be sent (e.g., because an emailapplication is currently open). Using this collection of information,the control circuitry can balance the current and future needs of theuser against the need to regulate emitted power. The control circuitrymay take a combination of corresponding actions including switchingantennas in an antenna diversity scheme, changing which wirelesscommunications protocol (algorithm) is used, changing which wirelesscommunications mode is used while complying with the same overallprotocol, changing the settings in a beam forming phase antenna array sothat emitted signals are directed towards a new location, etc.

Antennas in device 10 may be used to support any communications bands ofinterest. For example, device 10 may include antenna structures forsupporting local area network communications, voice and data cellulartelephone communications, global positioning system (GPS)communications, Bluetooth® communications, etc. As an example, a lowerantenna in region 20 of device 10 may be used in handling voice and datacommunications in one or more cellular telephone bands, whereas an upperantenna in region 22 of device 10 may provide coverage in a first bandfor handling Global Positioning System (GPS) signals at 1575 MHz and asecond band for handling Bluetooth® and IEEE 802.11 (wireless local areanetwork) signals at 2.4 GHz (as examples). Additional antennas may beprovided to implement antenna diversity schemes, phased antenna arrays(e.g., at 60 GHz), additional bands, etc.

A schematic diagram of an illustrative electronic device is shown inFIG. 2. Device 10 of FIG. 2 may be a portable computer such as aportable tablet computer, a mobile telephone, a mobile telephone withmedia player capabilities, a handheld computer, a remote control, a gameplayer, a global positioning system (GPS) device, a combination of suchdevices, or any other suitable electronic device.

As shown in FIG. 2, device 10 may include storage and processingcircuitry 28. Storage and processing circuitry 28 may include storagesuch as hard disk drive storage, nonvolatile memory (e.g., flash memoryor other electrically-programmable-read-only memory configured to form asolid state drive), volatile memory (e.g., static or dynamicrandom-access-memory), etc. Processing circuitry in storage andprocessing circuitry 28 may be used to control the operation of device10. This processing circuitry may be based on one or moremicroprocessors, microcontrollers, digital signal processors,application specific integrated circuits, etc.

Storage and processing circuitry 28 may be used to run software ondevice 10, such as internet browsing applications,voice-over-internet-protocol (VOIP) telephone call applications, emailapplications, media playback applications, operating system functions,etc. To support interactions with external equipment, storage andprocessing circuitry 28 may be used in implementing communicationsprotocols. Communications protocols that may be implemented usingstorage and processing circuitry 28 include internet protocols, wirelesslocal area network protocols (e.g., IEEE 802.11 protocols—sometimesreferred to as WiFi®), protocols for other short-range wirelesscommunications links such as the Bluetooth® protocol, cellular telephoneprotocols, MIMO protocols, antenna diversity protocols, etc.

Input-output circuitry 30 may be used to allow data to be supplied todevice 10 and to allow data to be provided from device 10 to externaldevices. Input-output devices 32 such as touch screens and other userinput interface are examples of input-output circuitry 32. Input-outputdevices 32 may also include user input-output devices such as buttons,joysticks, click wheels, scrolling wheels, touch pads, key pads,keyboards, microphones, cameras, etc. A user can control the operationof device 10 by supplying commands through such user input devices.Display and audio devices such as display 14 (FIG. 1) and othercomponents that present visual information and status data may beincluded in devices 32. Display and audio components in input-outputdevices 32 may also include audio equipment such as speakers and otherdevices for creating sound. If desired, input-output devices 32 maycontain audio-video interface equipment such as jacks and otherconnectors for external headphones and monitors.

Input-output devices 30 may include sensors. Data from sensors may beused to control the operation of device 10. For example, data fromsensors in device 10 may be used to control screen brightness, theorientation of information on screen 14, the operation of wirelesscircuitry, etc.

The sensors in device 10 may include thermal sensors 41. Thermal sensors41 may be used to detect where and when a user is touching device 10.For example, thermal sensors 41 may be used to monitor when a user isholding device 10 in the user's hand or may be used to monitor whendevice 10 is resting on the user's lap. Multiple thermal sensors 41 maybe provided to determine where a user's body is contacting device 10.There may be, for example, a thermal sensor associated with each ofmultiple antennas in device 10. If a temperature rise is measured nearone of the antennas, the power of that antenna may be reduced or otherappropriate action may be taken. Sensors 41 may be implemented usingthermocouples, bimetallic temperature sensors, solid state devices, orother suitable temperature sensors.

The sensors in device 10 may also include infrared heat sensors 42. Heatsensors 42 may measure heat using thermal imaging techniques (i.e., bydetecting the emitted infrared light from an object that ischaracteristic of the object's heat). If desired, Peltier effectcoolers, heat sinks, or other devices may be used to cool infrared heatsensors 42 to reduce noise. As with thermal sensors 41, infrared heatsensors 42 may be used to detect whether a user is touching device 10.Infrared heat sensors 42 may, for example, be used to detect when a useris holding device 10 or is resting device 10 on the user's lap. Morethan one infrared heat sensor 42 may be provided. This allows device 10to determine where an external object such as a part of a user's body iscontacting device 10. Each of the antennas in device 10 may be providedwith a respective infrared heat sensor 42. Appropriate action may betaken when heat is detected adjacent to a particular antenna. Forexample, the antenna may be temporarily inactivated. Infrared heatsensors 42 may be implemented using semiconductor devices or othersuitable infrared heat sensor equipment. Heat sensors 42 may operate inthe near-infrared band (i.e., 700 nm to 1400 nm), or may operate atlonger wavelengths such as those in the short-wavelength,mid-wavelength, or long-wavelength infrared bands.

Motion sensors 43, which may sometimes referred to as accelerometers,may be used to detect the earth's gravity and the relative motion ofdevice 10. Motion sensors 43 may therefore be used to determine howdevice 10 is oriented and whether device 10 is exhibiting movementcharacteristic of human use. For example, one or more motion sensors 43may be used in determining whether display 14 lies in a plane parallelto the plane of the earth's surface (as when device 10 is resting flaton a table and is not adjacent to a user's body) or at a non-zero anglerelative to the plane of the earth's surface. Sensors 43 can alsodetermine whether device 10 is oriented in a landscape orientation or aportrait orientation. Movement such as periodic transitions betweenlandscape and portrait mode or jiggling motions may be indicative ofhuman use and can be detected using sensors 43.

Capacitance sensors 44 may be integrated into a touch screen such asdisplay 14 or may be provided as stand-alone devices. Capacitancesensors 44, which may sometimes be referred to as touch sensors, may beused to determine when an external object such as a portion of a user'sbody has come into direct contact with device 10 or has come within agiven threshold distance of device 10 (e.g., within 5 mm). Data gatheredwith capacitance sensors 44 may be used to generate proximity data(i.e., data on the proximity of external objects to device 10), sosensors 44 may sometimes be referred to as proximity sensors orcapacitive proximity sensors.

Ambient light sensors 45 may be used to measure the amount of light thatis illuminating device 10. Ambient light sensors 45 may be sensitive inthe visible spectrum and/or the infrared. Sensors 45 may be used todetermine when a user's body is adjacent to particular portions ofdevice 10. For example, an ambient light sensor may be mounted on thefront face of device 10 to detect when a user has placed device 10 inthe vicinity of the user's head (and has thereby blocked light fromreaching the ambient light sensor). Infrared light proximity sensor 46may similarly use a light detector to determine whether an externalobject is in the vicinity of device 10. Infrared light proximity sensor46 may include an active emitter such as an infrared light emittingdiode. The diode may be modulated to improve the signal-to-noise ratioof the sensor. When light from the diode is reflected back into aninfrared light sensor in the infrared light proximity sensor 46, thesensor can generate an output signal indicating that an object is in thevicinity of sensor 46.

Acoustic sensors 47 may include microphones. The microphone may gatherambient noise readings that are indicative of whether device 10 is beingused by a user. For example, a microphone in an acoustic sensor may beused to detect the amount of ambient noise that is present in thevicinity of device 10. If ambient noise or certain types of ambientnoise (e.g., voices) are present, device 10 can conclude that device 10is being used by a user. Acoustic sensors 47 may also include acousticemitters (e.g., ultrasonic transducers). This type of acoustic sensormay use echolocation techniques to measure the distance between device10 and surrounding objects and may therefore serve as an acousticproximity sensor.

Electrical sensors 48 may be used to make electrical measurements.Electrical sensors 48 may include, for example, current sensors,resistance sensors, voltage sensors, etc. Electrodes that are formed aspart of electrical sensors 48 or that are electrically connected tosensors 48 may be used in making electrical measurements. As an example,a pair of electrical terminals may be located on portions of housing 12.An electrical sensor may measure the resistance between the electricalterminals. When a user holds device 10 in the user's hand, theelectrical sensor may detect a drop in resistance that is indicative ofthe presence of the user's hand.

If desired, input-output circuitry 30 may include cameras such ascameras 49. Cameras 49 may have image sensor integrated circuits thatinclude two-dimensional arrays of light-sensitive pixels. Image sensorsin cameras 49 may have sufficient resolution for forming photographs ormay have lower resolution (e.g., for gathering proximity data or otherdata on the environment of device 10). The image sensors in cameras 49may be sensitive in the visible spectrum, in the infrared spectrum, etc.Image data that is acquired by cameras 49 may include still images andmoving images (video clips). This information may be processed by ageneral purpose processor, a dedicated image processing circuit, orother circuitry in storage and processing circuitry 28.

Cameras 49 may gather information that is used in determining whether ornot a user's body or other external objects are in the vicinity ofdevice 10. Examples of acquired image data that may indicate that auser's body or other external object is in the vicinity of device 10 andantennas in device 10 include images containing a user's face or otheridentifiable body part, images containing motion, images containingflesh tones, hair, or other human attributes, image data such as videodata indicating motion towards the antennas of device 10 or otherportion of device 10, dark (black) images and other images in which acamera sensor (i.e., a camera window and camera module lens) in device10 has been obscured and therefore blocked by a human body part or otherexternal object, etc. This information may be combined with other sensordata to enhance human body detection accuracy.

Sensors such as sensors 41, 42, 43, 44, 45, 46, 47, 48, and 49 aremerely illustrative. Other sensors may be used to gather data on theenvironment and operation of device 10 if desired. These sensors mayserve as proximity sensors or may produce information that can be usedin conjunction with proximity sensor data to enhance the accuracy of theproximity sensor data. The sensors can be provided as single stand-aloneunits, as groups of multiple stand-alone units, in combined structuresin which the functionality of multiple sensors are combined into asingle unit, etc.

Wireless communications circuitry 34 may include radio-frequency (RF)transceiver circuitry formed from one or more integrated circuits, poweramplifier circuitry, low-noise input amplifiers, passive RF components,one or more antennas, and other circuitry for handling RF wirelesssignals. Wireless signals can also be sent using light (e.g., usinginfrared communications). Wireless communications circuitry 34 mayinclude radio-frequency transceiver circuits for handling multipleradio-frequency communications bands. For example, circuitry 34 mayinclude transceiver circuitry 36 and 38. Transceiver circuitry 36 mayhandle 2.4 GHz and 5 GHz bands for WiFi® (IEEE 802.11) communicationsand may handle the 2.4 GHz Bluetooth® communications band. Circuitry 34may use cellular telephone transceiver circuitry 38 for handlingwireless communications in cellular telephone bands such as the GSMbands at 850 MHz, 900 MHz, 1800 MHz, and 1900 MHz, and the 2100 MHz databand (as examples). Circuitry 38 may handle voice data and non-voicedata. Wireless communications circuitry 34 can include circuitry forother short-range and long-range wireless links if desired. For example,wireless communications circuitry 34 may include global positioningsystem (GPS) receiver equipment such as GPS receiver circuitry 37 forreceiving GPS signals at 1575 MHz or for handling other satellitepositioning data, wireless circuitry for receiving radio and televisionsignals, paging circuits, etc. In WiFi® and Bluetooth® links and othershort-range wireless links, wireless signals are typically used toconvey data over tens or hundreds of feet. In cellular telephone linksand other long-range links, wireless signals are typically used toconvey data over thousands of feet or miles.

Wireless communications circuitry 34 may include antennas 40. Antennas40 may be formed using any suitable antenna types. For example, antennas40 may include antennas with resonating elements that are formed fromloop antenna structure, patch antenna structures, inverted-F antennastructures, slot antenna structures, planar inverted-F antennastructures, helical antenna structures, hybrids of these designs, etc.Different types of antennas may be used for different bands andcombinations of bands. For example, one type of antenna may be used informing a local wireless link antenna and another type of antenna may beused in forming a remote wireless link antenna.

With one suitable arrangement, device 10 may have antennas in regions ofdevice 10 such as upper region 22 and lower region 20. One or more upperantennas for device 10 may be formed in region 22. One or more lowerantennas for device 10 may be formed in region 20. In devices with otherform factors such as laptop and tablet computers, wearable devices,computer monitors with integrated computers, etc., antennas may belocated in other suitable regions (e.g., at the four corners of arectangular device, on front and back surfaces, along edge regions of adevice, in one or more arrays, etc.

Illustrative wireless communications circuitry that may be used incircuitry 34 of FIG. 2 in device 10 is shown in FIG. 3. As shown in FIG.3, wireless communications circuitry 50 may include one or more antennassuch as antennas 40. Baseband module 52 may be implemented using asingle integrated circuit (e.g., a baseband processor integratedcircuit) or using multiple circuits. Baseband processor 52 may receivesignals to be transmitted over antennas 40 at input line 89 (e.g., fromstorage and processing circuitry 28). Baseband processor 52 may providesignals that are to be transmitted to transmitter circuitry within RFtransceiver circuitry 54. The transmitter circuitry may be coupled topower amplifier circuitry 56 via path 55. Control signals from storageand processing circuitry 28 (FIG. 1) may be used to control the power ofthe radio-frequency signals that the transmitter circuitry withintransceiver circuitry 54 supplies to the input of power amplifiercircuitry 56 via path 55.

During data transmission, power amplifier circuitry 56 may boost theoutput power of transmitted signals to a sufficiently high level toensure adequate signal transmission. Amplified signals may be suppliedto circuitry 57 on output path 65. Radio-frequency (RF) output stagecircuitry 57 may contain radio-frequency switches and passive elementssuch as duplexers and diplexers. The switches in RF output stagecircuitry 57 may, if desired, be used to switch circuitry 50 between atransmitting mode and a receiving mode. Duplexer and diplexer circuitsand other passive components in RF output stage 57 may be used to routeinput and output signals based on their frequency. A connector in stage57 may allow an external cable to be connected to device 10 forcalibration.

Matching circuitry 60 may include a network of components such asresistors, inductors, and capacitors and ensures that antennas 40 areimpedance matched to the rest of the circuitry 50. Wireless signals thatare received by antennas 40 may be passed to receiver circuitry intransceiver circuitry 54 over a path such as path 67. A low noiseamplifier in the receiver circuitry of transceiver circuits 54 may beused to amplify incoming wireless signals from path 67.

Each power amplifier (e.g., each power amplifier in power amplifiers 56)may include one or more power amplifier stages. As an example, eachpower amplifier may be used to handle a separate communications band andeach such power amplifier may have three series-connected poweramplifier stages. Circuitry 56 and the amplifier stages in circuitry 56may have inputs that receive control signals and power supply signalsthat may be adjusted to selectively turn on and off gain stages and thatmay be otherwise adjusted to control the output power of theradio-frequency antenna signals on path 65. Output power can also becontrolled by adjusting the power on path 55 (e.g., using transceivercircuitry 54). By adjusting wireless circuitry 50 in this way, thetransmitted power of the radio-frequency antenna signals that passthrough antennas 40 may be adjusted in real time. For example,transmitted antenna signal power may be adjusted in real time inresponse to the detection of the presence of a user's body or otherexternal object in the presence of device 10 and antennas 40.

Wireless circuitry 50 may include radio-frequency signal monitoringcircuitry that may be used in implementing an antenna-based proximitysensor. The radio-frequency signal monitoring circuitry may measure thephase and magnitude of antenna signals associated with antennas 40.Based on this radio-frequency signal information, storage and processingcircuitry 28 (FIG. 1) can determine whether the behavior of antennas 40are being influenced by the presence of a user's body or other externalobject. When a user's body or other object is detected, the output powerof the radio-frequency signals passing through antenna 40 can be loweredto ensure that regulatory limits are satisfied or other suitable actionsmay be taken.

Illustrative wireless circuitry 61 that may be used in implementing anantenna-based proximity sensor of this type is shown in FIG. 4. As shownin FIG. 4, wireless circuitry 61 may receive transmitted radio-frequencyantenna signals on path 63 (e.g., from power amplifier circuitry 56,output stage 57, matching circuitry 60, etc.). Coupler 62 may route thetransmitted radio-frequency antenna signals to antenna 40, so that thesesignals are transmitted over the air to a remote receiver.

Coupler 62 may also serve as a tap that routes a fraction of thetransmitted signals from path 63 to phase and magnitude detectorcircuitry 64 over path 69. Radio-frequency antenna signals that arereceived by coupler 62 from antenna 40 (e.g., transmitted signals thathave reflected from antenna 40) may be routed to phase and magnitudedetector circuitry 64. Radio-frequency signal phase and magnitudedetector circuitry 64 may monitor the values of the signals on paths 69and 71 and may generate corresponding measured phase and magnitudeinformation that is passed to signal processor 66 over path 73.Circuitry such as circuitry 64 and 66 may be implemented using dedicatedhardware, one or more general purpose processors, digital signalprocessing circuitry, or other suitable control circuitry (e.g., storageand processing circuitry 28 of FIG. 1).

Antenna signal monitoring circuitry 61 may be used to monitor one, two,more than two, or all of the antennas 40 in device 10. Using antennasignal monitoring circuitry such as circuitry 61 of FIG. 4, the behaviorof each of antennas 40 and therefore information on the environment inwhich each of antennas 40 is operating may be measured in real time.This information may be used as antenna-based proximity sensor data(i.e., circuitry 61 may be used to serve as one or more proximitysensors that are sensitive to the presence of external objects in thevicinity of each of antennas 40). Whenever the measurements of circuitry61 and the information of other sensors in device 10 indicate that auser's body or other external object is in the vicinity of device 10 ora particular antenna 40 in device 10 (i.e., closer than a thresholddistance), device 10 may take appropriate actions.

Circuitry 61 may be used to make real-time antenna impedancemeasurements, as illustrated in connection with the Smith chart of FIG.5. In the Smith chart of FIG. 5, antenna impedances for an illustrativeone of antennas 40 are measured as a function of several differentoperating conditions. A fifty ohm antenna impedance is characterized byimpedance point 80 in the chart of FIG. 5. An antenna with an impedanceclose to point 80 may be considered well matched to a fifty ohmtransmission line in device 10.

Data points for the curves of FIG. 5 may be gathered in real time usingcircuitry 61. Impedance data may be gathered while transceiver circuitry54 is transmitting wireless data signals during normal operation (e.g.,while transceiver circuitry 54 is transmitting data over a local orremote wireless communications link). In this type of arrangement,impedance measurements may be made using an in-band arrangement (e.g.,measurements may be made in the communications band being used by device10 to transmit wireless data). In addition, or as an alternative, atunable radio-frequency source in transceiver circuits 54 may produce aprobe frequency that is swept through frequencies of interest whilecircuitry 61 gathers phase and magnitude data that is converted toimpedance data points. The probe frequency may be restricted to in-bandfrequencies (i.e., frequencies on segment 70) or may involve the use ofout-of-band frequencies (i.e., frequencies elsewhere on curve 68).In-band and out-of-band antenna impedance measurements such as these maybe made periodically, whenever normal transceiver circuitry in device 10is quiescent, when other proximity sensors indicate that an externalobject might be present, when other criteria are satisfied, etc.

The example of FIG. 5 illustrates how antenna impedance is influenced bythe environment in which device 10 operates. In the absence of anyexternal objects, an antenna in device 10 may, for example, becharacterized by a curve such as curve 68. Darkened line segment 70,which extends between band edge point 72 and band edge point 74 maycorrespond to the antenna impedances associated with a communicationsband of interest.

If an external object such as a metal surface or a user's hand comesinto contact with an antenna 40 (e.g., if device 10 is placed on a metalsurface or if a user grips device 10 so that the user's hand or otherbody part is flush with an antenna feed portion of antenna 40), theimpedance of antenna 40 may change. For example, the impedance ofantenna 40 may be characterized by a curve such as curve 76. Darkenedline segment 78, which extends between band edge point 77 and band edgepoint 79 may correspond to the antenna impedances associated with thecommunications band of interest under these new operating conditions.Circuitry 61 may detect the transformation of curve segment 70 intocurve segment 78 on characteristic curve 76 and may therefore concludethat device 10 is in the vicinity of a metal surface or user's hand.

In the presence of portions of the human body or other external objectsthat exhibit significant losses, the impedance of the antenna may becharacterized by a curve such as curve 82. In this type of situation,curve segment 70 is transformed into a curve segment such as curvesegment 85, extending from point 86 to point 84 on curve 82. Due to thelosses produced by the external object, there may be a relatively modestnumber of signal reflections, resulting in a curve segment location thatis relatively close to point 80.

Actions that may be taken when close proximity of an external object toone or more antennas is detected may include tuning antennas in device10, tuning matching circuitry in device 10, tuning antenna feeds indevice 10, etc.

Consider, as an example, the illustrative antenna of FIG. 6. Antenna 40in the FIG. 6 example has an inverted-F configuration. Main resonatingelement arm 114 is connected to ground 88 through a short circuit pathsuch as path 132, a feed path (see, e.g., terminals 110 and 108), andone or more optional paths such as the path formed by element 120 (e.g.,a switch), the path formed by element 122, and the path formed byelements 124 and 126. Optional antenna resonating element branches suchas branch 130 may be coupled to antenna 40 (e.g., by connecting branch130 to main resonating element arm 114).

As shown in FIG. 6, antenna 40 may be feed from a source such as source90 (i.e., transceiver circuitry such as transceiver circuitry 54 of FIG.3). A transmission line having paths such as positive antenna signalpath 94 and ground antenna signal path 92 may be used to conveyradio-frequency antenna signals from source 90 to antenna 40.

Matching circuitry 60 may be interposed in the path between source 90and antenna 40. Matching circuitry 60 may include series-connected andshunt-connected tunable components such as tunable component 98.Component 98 may be a tunable capacitor, a tunable inductor, a tunableresistor, a tunable component or network that includes multiplecomponents of this type, a tunable network that includes a mixture offixed and tunable components, etc.

If desired, controllable switches such as switch 100 may be used toselectively adjust circuitry 60. Switches such as switch 100 may beradio-frequency switches that are implemented usingmicroelectromechanical systems (MEMS) technology, using field-effecttransistor devices, or other suitable switch arrangements. Asillustrated in the example of FIG. 6, switches such as switch 100 may beused to selectively connect circuit elements such as circuit element 102to paths 94 and 92 (i.e., in a series or shunt configuration or as partof a more complex network). Circuit element 102 may be a fixed oradjustable component such as a resistor, capacitor, inductor, etc.

Transmission line paths such as positive transmission line path 104 andground transmission line path 106 may be used to interconnect matchingcircuitry 60 to the antenna feed of antenna 40. The antenna feed mayhave a fixed or tunable configuration. In the example of FIG. 6, theantenna feed for antenna 40 is tunable between a first antenna feedconfiguration in which switch 118 has a first position and a secondantenna feed configuration in which switch 118 has a second position.When switch 118 is in its first position, terminal 108 is connected toterminal 112, so that terminal 112 serves as the positive antenna feedterminal for antenna 40. When switch 118 is in its second position,terminal 108 is connected to terminal 116, so that terminal 116 servesas the positive antenna feed terminal for antenna 40. Feed terminals 112and 116 are located at different positions along the length of mainresonating element arm 114, so the impedance and therefore the frequencyresponse of antenna 40 can be adjusted by using switch 118 to controlthe feed location in antenna 40. The arrangement of FIG. 6 is merelyillustrative. In general, antennas such as antenna 40 in device 10 mayhave tunable feeds formed from two or more feed points, tunable feedsthat involve one, two, three, or more than three switches, non-tunablefeeds, etc.

As shown in FIG. 6, antenna 40 may have a resonating element that iscomposed of tunable elements. This allows the size and shape of theresonating element in antenna 40 to be controlled by storage andprocessing circuitry 28. In the FIG. 6 arrangement, switch 128 may havetwo states (as an example). In its first state, switch 128 may be open.This electrically disconnects antenna resonating element portion 130from antenna resonating element portion 114. In its second state, switch128 may be closed. When switch 128 is closed, resonating element armportion 130 is electrically connected to arm 114, thereby adjusting thesize and shape of the antenna resonating element and adjusting thefrequency response of the antenna. Additional resonating elementstructures may likewise be selectively connected and disconnected fromthe antenna resonating element in antenna 40 if desired. Circuitcomponents (e.g., resistors, inductors, and capacitors) may beinterconnected with switches such as switch 128 (e.g., for impedancematching).

Antenna 40 may also be adjusted by controlling components such as switch120 and tunable component 122. Switches such as switch 120 (e.g., a MEMsor transistor switch) may be opened and closed to tune antenna 40.Tunable component 122 may be a tunable capacitor, tunable resistor,tunable inductor, or other suitable circuitry having a tunable impedancethat can be adjusted to tune antenna 40. In the FIG. 6 example, tunablecomponent 122 has been connected between antenna resonating element arm114 and ground antenna element 88, but this is merely illustrative.Tunable components such as component 122 may be connected in series withantenna resonating element branches such as branches 114 and 130, may beconnected in series with short circuit antenna branch 132, may beconnected in parallel with these antenna structures, or may otherwise beinterconnected with the components of antenna 40.

Tuning capabilities for antenna 40 may also be implemented usingswitches such as switch 120 and switch 124. Switches 120 and 124 may,for example, be controlled by storage and processing circuitry 28. Whenswitch 124 is in its open position, component 126 may be disconnectedfrom antenna 40. When switch 124 is in its closed position, component126 may be connected between resonating element arm 114 and ground 88.Adjustable circuits such as these may be interconnected in series orparallel with any suitable antenna component (e.g., arm 130, arm 132,arm 114, ground 88, etc.). Fixed components such as capacitors,resistors, and inductors may also be included in the tuning circuitry ofantenna 40.

These antenna adjustment schemes may be used individually or together.For example, antenna 40 can be adjusted by adjusting a matching networkthat is coupled to the antenna's transmission line, by adjusting theposition of the antenna feed (e.g., using switching circuitry), byadjusting antenna tuning (e.g., by using switches and/or tunable circuitcomponents), and by adjusting the size and shape of the antenna itself(e.g., by using switches or other controllable circuit components toselectively change the size and shape of the antenna resonating element,the antenna ground, or parasitic antenna elements). If desired, onlysome or only one of these adjustment mechanisms may be included inantenna 40. The arrangement of FIG. 6 is an example.

FIG. 7 is a top view of an illustrative electronic device that has arectangular outline. As shown in FIG. 7, antennas may be mounted in fourcorners of device 10. For example, antenna 40A may be mounted in anupper left corner, antenna 40B may be mounted in an upper right corner,antenna 40C may be located in a lower left corner, and antenna 40D maybe located in a lower right corner. If desired, additional antennas maybe mounted in device 10 (e.g., at one or more midpoints along the edgesof device 10, at interior locations, on external antenna mounts, etc.).

Control circuitry 134 (e.g., storage and processing circuitry andwireless circuitry) may be used in gathering antenna signals fromantennas 40A, 40B, 40C, and 40D (e.g., for implementing antenna-basedproximity sensors) and may be used in controlling antennas 40A, 40B,40C, and 40D. For example, antenna adjustments may be made to antennas40A, 40B, 40C, and 40D using antenna control techniques of the typedescribed in connection with FIG. 6. These antenna adjustments may beused to control the bandwidth of the antennas, the communications bandscovered by the antennas, the impedance of the antennas, etc. Eachantenna may have associated wireless circuits such as circuitry 50 ofFIG. 3. This circuitry may be adjusted to control the output power ofeach antenna. For example, the power that is transmitted by antennasthat are near to external objects can be reduced or these antennas canbe temporarily deactivated. If, as an example, an external object isdetected in the vicinity of antenna 40B, antenna 40B can be deactivatedand one, two, or three of the remaining antennas 40A, 40C, and 40D maybe used. Adjustments may also be made to the type of communicationsscheme that is being used during data transmissions. For example, a MIMOscheme may be used that involves use of all four antennas (40A, 40B,40C, and 40D) of FIG. 7. If an external object is detected in thevicinity of antennas 40A, 40B, and 40C (as an example), use of the MIMOscheme can be halted and an alternate scheme may be used such as amultiple-input-single-output communications scheme that uses only asingle antenna such as antenna 40D to transmit signals. Combinations ofthese approaches may be used if desired.

Device 10 may include a phased antenna array such as the array shown inFIG. 8. As shown in FIG. 8, an array of antennas 40 may be coupled to asignal path such as path 140. During signal transmission operations,path 140 may be used to supply radio-frequency antenna signals to theantenna array for transmission to external wireless equipment. Duringsignal reception operations, path 140 may be used to routeradio-frequency antenna signals that have been received by antennas 40from external wireless equipment to receiver circuitry in device 10.

The use of multiple antennas in array 40 allows beam steeringarrangements to be implemented by controlling the relative phases of thesignals for the antennas. In the example of FIG. 8, antennas 40 eachhave a corresponding radio-frequency phase controller 138. There may be,for example, 3-30 (or 5-20) antennas 40 and 3-30 (or 5-20) correspondingphase control circuits 138.

Control circuitry 136 may use phase controllers 138 or other suitablephase control circuitry to adjust the relative phases of the transmittedradio-frequency antenna signals that are provide to each of the antennasin the antenna array. If, for example, control circuitry 136 is adjustedto produce a first set of phases on the transmitted signals, transmittedsignals 144 from antennas 40 will form a radio-frequency beam such asbeam 144 that is oriented in the direction of point A. If, however,control circuitry 136 adjusts phase controllers 138 to produce a secondset of phases with controllers 138, transmitted signals 146 will form aradio-frequency beam such as beam 142 that is oriented in the directionof point B. Phase tuning can also be used steer the direction of theantenna array during signal reception operations. With one suitablearrangement, the array of antennas in FIG. 8 may be used to handle acommunications band such as a communications band at 60 GHz (as anexample). Wireless communications in other frequency bands of interestmay also be supported.

During normal operations, the settings of control circuitry 136 may beadjusted in real time to maximize signal strength (e.g., to maximizesignal-to-noise ratio) or otherwise optimize performance. If, however,an external object such as a user's body is detected in the proximity ofdevice 10, control circuitry 136 may be used to steer the direction inwhich the antenna array operates so as to bypass the external object. Asan example, if a proximity sensor or other sensor detects that anexternal object is located at point A, control circuitry 136 may be usedto adjust the antenna array so that the antenna sends and receivessignals along path 142 in the direction of point B. Antenna steering canbe used in combination with other responses to detected objects (e.g.,selective or collective transmit power reductions, communications modeadjustments, communications band adjustments, etc.).

Illustrative steps involved in using an electronic device in whichactions may be taken in response to detected objects in the vicinity ofthe device and its antennas are shown in FIG. 9.

At step 148, antenna signal monitoring circuitry such as circuitry 61 ofFIG. 4 may be used to make real time measurements of the impedance ofantenna 40. One or more of the antennas (i.e., all of the antennas) indevice 10 may be monitored in this way. Phase and magnitude detectorcircuitry 64 can use information such as phase and magnitude informationon tapped outgoing radio-frequency antenna signals and the tappedreflected radio-frequency antenna signals to determine the impedance ofantenna 40. As described in connection with the Smith chart of FIG. 5,the impedance of each antenna may be monitored at in-band frequencies orat out-of-band frequencies. An optional signal generator may be used togenerate test signals or, if desired, signal measurements may be madeusing existing transmitted data signals.

At step 150, storage and processing circuitry 28 (FIG. 2) may be used toanalyze the antenna impedance measurements from circuitry 61. Theresults of this analysis may reveal, as an example, that a user's bodyor other external object is located in the vicinity of certain antennasin device 10, as described in connection with FIG. 5.

At step 152, storage and processing circuitry 28 may gather additionalinformation on the state of device 10. For example, storage andprocessing circuitry 28 may gather information on which communicationsbands are being used in wirelessly communicating with externalequipment, may gather information on current transmit power settings,may gather sensor information from additional sensors (e.g., the sensorsof FIG. 2), etc.

At step 154, storage and processing circuitry 28 may process the signalsfrom the antenna-based proximity sensor (i.e., circuitry 61), thesensors of FIG. 2, and other circuitry in device 10 to determine whetherantenna adjustments and other adjustments to the operation of thewireless circuitry of device 10 should be made. During the processing ofstep 154, device 10 may, for example, determine, for each antenna 40,whether an external object such as a user's body is in the vicinity ofthe antenna. A weighting scheme may be used to weight data fromdifferent sensors.

As an example, consider a device that contains three antennas andcorresponding antenna-based sensors of the type shown in FIG. 4,light-based proximity sensor such as sensors 45, and capacitance-basedproximity sensors such as sensors 44 (as examples). The light-based andcapacitance-based sensors may be located adjacent to respectiveantennas. Measurements from the antenna-based sensors may indicate thatan external object is blocking the first antenna (i.e., thesemeasurements may indicate that an external object is adjacent to thefirst antenna and is therefore within a given distance of the firstantenna). The capacitance-based sensors may produce identical results,but the light-based sensor may indicate that both the first and secondantennas are blocked. By analyzing data from all three sensors, device10 can determine whether external objects are in the vicinity of eachantenna and can determine a suitable course of action.

For example, device 10 can inhibit operation of the first and secondantennas in favor of the third antenna, device 10 can turn off all threeantennas, or device 10 can reduce power to the first and second antennaswhile continuing to operate all three antennas. Device 10 may also makeadjustments to each antenna by controlling antenna matching circuitry,antenna feeds, antenna resonating elements, and antenna tuning circuitsas described in connection with FIG. 6. In devices that contain a phasedantenna array, the direction of the signal beam associated with theantenna may be steered in response to the proximity information. Forexample, if an external object is detected in one location, the arraycan be adjusted so that antenna signals are oriented in a differentdirection.

The actions that are taken at step 154 in response to processing thedata that has been gathered may include adjustments to thecommunications band that is being used by the wireless circuitry (e.g.,by shifting from a 5.0 GHz band to a 2.4 GHz band so that moreappropriate antennas may be used). Device 10 may also decide to ceaseMIMO operation (e.g., so that a blocked antenna is not used for signaltransmission or is not used for signal transmission or reception). If itis desired to reduce transmit powers, device 10 may also decide toreduce data rates to sustainable levels (i.e., levels that areappropriate to the amount of signal strength that is available).

If desired, the operations of steps 148, 150, 152, and 154 may beimplemented in a device without extensive redundant antenna resources.For example, a device may have only one cellular telephone antenna.Circuitry 61 of FIG. 4 may be used to monitor the impedance of theantenna in real time. Device 10 may reduce the output power of theantenna when impedance measurements of the type described in connectionwith FIG. 7 reveal that an external object is partly or completelyblocking the antenna.

In general, any suitable information may be used in determining whatactions are appropriate when adjusting the antennas. For example,information from the sensors of FIG. 2, from application software, fromcircuitry 61 of FIG. 4, and other information may be processed by device10 to determine whether an external object is adjacent to the antenna(e.g., whether an external object is within the vicinity of the antennaby virtue of being within a given threshold distance of the antenna). Inresponse, device 10 may reduce or otherwise adjust antenna powers andother antenna circuit attributes, may control communications modes, maycontrol communications bands, antenna phases, etc. As indicated by line156 in FIG. 9, these operations may be repeated (e.g., continuously)during operation of device 10.

The foregoing is merely illustrative of the principles of this inventionand various modifications can be made by those skilled in the artwithout departing from the scope and spirit of the invention. Theforegoing embodiments may be implemented individually or in anycombination.

What is claimed is:
 1. An electronic device, comprising: an antenna withwhich the electronic device transmits radio-frequency signals accordingto a wireless communications mode; circuitry that is coupled to theantenna and that makes radio-frequency signal phase and magnitudemeasurements; and storage and processing circuitry that determineswhether an external object is adjacent to the antenna by processing theradio-frequency signal phase and magnitude measurements, wherein thestorage and processing circuitry identifies what tasks are beingperformed by the electronic device and, in response to determining thatthe external object is adjacent to the antenna, adjusts the wirelesscommunications mode based at least partly on the tasks that are beingperformed by the electronic device.
 2. The electronic device defined inclaim 1, wherein the circuitry comprises phase and magnitude detectioncircuitry.
 3. The electronic device defined in claim 1, wherein thestorage and processing circuitry is configured to identify tasks thatare scheduled to be performed by the electronic device and, in responseto determining that the external object is adjacent to the antenna,adjust the wireless communications mode based at least partly on thetasks that are scheduled to be performed by the electronic device. 4.The electronic device defined in claim 3, wherein the storage andprocessing circuitry is configured to, in response to determining thatthe external object is adjacent to the antenna, adjust the wirelesscommunications mode based at least partly on whether a message isscheduled to be sent by the electronic device.
 5. The electronic devicedefined in claim 4, wherein the message comprises an email message. 6.The electronic device defined in claim 1, wherein the storage andprocessing circuitry is configured to identify tasks that are likely tobe performed by the electronic device and, in response to determiningthat the external object is adjacent to the antenna, adjust the wirelesscommunications mode based at least partly on the tasks that are likelyto be performed by the electronic device.
 7. The electronic devicedefined in claim 1, wherein the storage and processing circuitry isconfigured to, in response to determining that the external object isadjacent to the antenna, adjust the wireless communications mode basedat least partly on whether a telephone call is being performed by theelectronic device.
 8. The electronic device defined in claim 1, whereinthe storage and processing circuitry is configured to, in response todetermining that the external object is adjacent to the antenna, switchan additional antenna into use so that the additional antenna transmitsthe radio-frequency signals based at least partly on the tasks that arebeing performed by the electronic device.
 9. The electronic devicedefined in claim 1, wherein the storage and processing circuitry isconfigured to, in response to determining that the external object isadjacent to the antenna, change a wireless communications protocol usedby the electronic device to transmit the radio-frequency signals basedat least partly on the tasks that are being performed by the electronicdevice.
 10. The electronic device defined in claim 1, wherein thestorage and processing circuitry is configured to, in response todetermining that the external object is adjacent to the antenna, changea transmit power used by the electronic device to transmit theradio-frequency signals based at least partly on the tasks that arebeing performed by the electronic device.
 11. The electronic devicedefined in claim 1, further comprising: a sensor configured to gathersensor data in response to the external object, wherein the storage andprocessing circuitry is configured adjust the communications mode basedat least partly on the phase and magnitude measurements, the sensordata, and the tasks that are being performed by the electronic device.12. A method of using an electronic device, the method comprising:transmitting radio-frequency antenna signals through an antenna; withphase and magnitude detector circuitry that is coupled to the antenna inthe electronic device, making radio-frequency antenna signal phase andmagnitude measurements to produce proximity data; with the controlcircuitry, identifying what task is being performed by the electronicdevice; and with the control circuitry, adjusting a wirelesscommunications mode of the electronic device based on the proximity datafrom the phase and magnitude detector circuitry and the identified task.13. The method defined in claim 12, further comprising: with the controlcircuitry, determining whether an external object is adjacent to theantenna based on the proximity data from the phase and magnitudedetector circuitry; and with the control circuitry in response todetermining that the external object is adjacent to the antenna,adjusting the wireless communications mode based on the identified task.14. The method defined in claim 12, wherein identifying what task isbeing performed by the electronic device comprises: determining whetherthe electronic device is currently being used for a telephone call. 15.The method defined in claim 13, wherein adjusting the wirelesscommunications mode comprises adjusting the wireless communications modebased on the proximity data and whether the electronic device iscurrently being used for the telephone call.
 16. The method defined inclaim 12, wherein identifying what task is being performed by theelectronic device comprises: determining whether an email message hasbeen queued for transmission over the antenna.
 17. The method defined inclaim 12 wherein adjusting the wireless communications mode of theelectronic device based on the proximity data and the identified taskcomprises: adjusting a selected one of antenna transmit power, wirelesscommunications protocol, and a tunable circuit coupled to the antennabased on the proximity data and the identified task.
 18. An electronicdevice, comprising: an antenna with which the electronic devicetransmits radio-frequency signals according to a wireless communicationsmode; circuitry coupled to the antenna that gathers phase and magnitudedata; and storage and processing circuitry that is configured toidentify what task is being performed by the electronic device and toadjust the wireless communications mode based at least partly on thephase and magnitude data and the task that is being performed by theelectronic device.
 19. The electronic device defined in claim 18,wherein the circuitry comprises phase and magnitude detection circuitrythat makes phase and magnitude measurements to generate the phase andmagnitude data.
 20. The electronic device defined in claim 18, furthercomprising: an additional antenna, wherein the storage and processingcircuitry is configured to adjust the wireless communications mode basedat least partly on the task that is being performed by the electronicdevice by switching between a first communications mode in which theantenna and the additional antenna transmit the radio-frequency signalsand a second communications mode in which only the antenna transmits theradio-frequency signals.